package com.wsy.mapper;

import com.wsy.entity.Customer;
import com.wsy.entity.Line;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CustomerMapper {


//    @Select("select * from customer where account = #{account}")
    Customer getUserByAccount(String account);

    @Insert("insert into customer ( account, `name` , password,type) values (#{account}, #{name}, #{password},#{type})")
    int saveUser(Customer customer);

    @Update("update customer set token = #{token} where customerID = #{id}")
    int  setTokenToUser(@Param( "token")String token,@Param("id") Integer id);

//    查询购物车
    List<Line> getCat(Integer customerID);
    //    查询购物车
    List<Line> getOrder(Integer odID);

//    添加订单
    int postOrder(Line line);

//    删除购物车
    int delCat(int id);

    Line gettoken(String token);

    List getNum();

    int putNum(int num);

    int postAddcar( @Param("id") int cusid,@Param("LineID") int LineIDid);

    Line getjie();
}
